<template>
  <!--引用组件TabBar 因为组件名字是驼峰命名，所以这里转换为小写用-符号分割-->
  <!--
    TabBar的设计原理
    如本例子，tab-bar 为整个组件，然后里面有4个点击的地方
    那么我就在tab-bar里面定义一个插槽，传入4个最小组件tab-baritem进去
    然后在tab-baritem里面 定义了3个插槽，分别传入两个图片和一个文字进去
  -->
  <tab-bar>
    <tab-baritem link="/home"><!--因为这里是固定传值，不用绑定变量，所以不用v-bind:link-->
      <img slot="item-icon" src="~assets/img/tabbar/home.svg">
      <img slot="item-icon-active" src="~assets/img/tabbar/home_active.svg">
      <div slot="item-text">首页</div>
    </tab-baritem>
    <tab-baritem link="/category">
      <img slot="item-icon" src="~assets/img/tabbar/category.svg">
      <img slot="item-icon-active" src="~assets/img/tabbar/category_active.svg">
      <div slot="item-text">分类</div>
    </tab-baritem>
    <tab-baritem link="/shopcart">
      <img slot="item-icon" src="~assets/img/tabbar/shopcart.svg">
      <img slot="item-icon-active" src="~assets/img/tabbar/shopcart_active.svg">
      <div slot="item-text">购物车</div>
    </tab-baritem>
    <tab-baritem link="/profile">
      <img slot="item-icon" src="~assets/img/tabbar/profile.svg">
      <img slot="item-icon-active" src="~assets/img/tabbar/profile_active.svg">
      <div slot="item-text">我的</div>
    </tab-baritem>
  </tab-bar>
</template>

<script>
import TabBar from 'components/common/tabbar/TabBar.vue'
import TabBaritem from 'components/common/tabbar/TabBaritem.vue'
export default {
  name: "MainTabBar",
  components: {
    TabBar,
    TabBaritem
  }
}
</script>

<style scoped>
</style>
